feat: support multiple payment gateway#21374
Conversation
spartacus
|
||||||||||||||||||||||||||||
| Project |
spartacus
|
| Branch Review |
multi-payment-gateway
|
| Run status |
|
| Run duration | 04m 16s |
| Commit |
|
| Committer | ijitendrasap |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
3
|
|
|
0
|
|
|
0
|
|
|
101
|
| View all changes introduced in this branch ↗︎ | |
There was a problem hiding this comment.
Please make sure this stays backward compatible. Changing APIs from a single OpfActiveConfiguration to OpfActiveConfiguration[] (and similar signature changes like activeConfiguration → activeConfigurations) is a breaking change for existing consumers.
We’d like this to be strictly backward compatible and preserve the exact old behavior when a single OpfActiveConfiguration is provided. Only when an array is passed should we execute the new multi-config logic.
Concretely, please add explicit branching everywhere the new logic is used, e.g.:
@Input() activeConfiguration: OpfActiveConfiguration | OpfActiveConfiguration[];
if (Array.isArray(this.activeConfiguration)) {
// here TS knows: OpfActiveConfiguration[]
// run NEW multi-config logic
} else {
// here TS knows: OpfActiveConfiguration
// keep OLD single-config logic
}
Same principle for any helpers/services that changed from activeConfiguration → activeConfigurations: keep the old single-config path intact, and only use the new code when an array is actually provided.
Merge Checks Failed |
Merge Checks Failed |
No description provided.